package com.zf.zffencheng.controller.tenant;

import com.zf.zffencheng.model.Result;
import com.zf.zffencheng.model.vo.AdminLoginInfoVo;
import com.zf.zffencheng.model.vo.PalaceRegionVo;
import com.zf.zffencheng.service.PalaceRegionService;
import com.zf.zffencheng.util.UserContextUtils;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName: PalaceRegionController <br/>
 * Description:  <br/>
 * date: 2021/5/28 16:12<br/>
 *
 * @author william <br/>
 */
@RestController
@Api(tags = "区域选择")
@RequestMapping("/sapi/tenant/palace/region")
public class PalaceRegionController {
    @Autowired
    private PalaceRegionService palaceRegionService;
    @GetMapping("tree")
    public Result tree(){
        AdminLoginInfoVo currentAdminInfo = UserContextUtils.getCurrentAdminInfo();
        Integer tenantId = currentAdminInfo.getAccountId();
        List<PalaceRegionVo> list = palaceRegionService.tree(tenantId);
        return Result.ok(list);
    }
}
